package com.heima.wemedia.controller.v1;


import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.pojos.WmChannel;
import com.heima.wemedia.mapper.WmChannelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/v1/channel")
public class WmChannelController {


    @Autowired
    private WmChannelMapper wmChannelMapper;
    @GetMapping("/channels")
    public ResponseResult list(){
        //查询Mapper接口
        List<WmChannel> channels = wmChannelMapper.selectList(null);

        ResponseResult result=new ResponseResult();
        result.setData(channels);
        return  result;
    }
}
